import type { AxiosPromise } from "axios";
import type {
  ProcInstReq,
  FlowProcInstPage,
  FlowProcInstKey,
  FlowProcInstModel,
  TaskReq,
  FlowTaskPage,
} from "../task/types";

import type { EntityApi } from "jmash-core";

// 接口
export interface MonitorApi extends EntityApi {
  getKey(model: FlowProcInstModel): FlowProcInstKey;
  // 查询流程实例
  findPage(req: ProcInstReq): AxiosPromise<FlowProcInstPage>;
  // 暂停/恢复流程实例.
  suspendProcInst(req: FlowSuspendProcInstReq): AxiosPromise<boolean>;
}

/**
 * 暂停/恢复流程实例请求.
 */
export interface FlowSuspendProcInstReq {
  /**
   * 用于检测重复请求的唯一字符串ID.
   */
  requestId?: string;
  /**
   * 流程实例ID.
   */
  procInstId?: string;
  /**
   * 暂停/恢复.
   */
  suspend?: boolean;
}
